package sudroid.net2;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.net.Authenticator;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.ProtocolException;
import java.net.Proxy;
import java.net.Proxy.Type;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import sudroid.CleanUtils;
import sudroid.LogUtils;
import sudroid.TextUtils;

public class HttpClient
  implements Serializable
{
  public static final int BAD_GATEWAY = 502;
  public static final int BAD_REQUEST = 400;
  public static final String BOUNDARY = "7d4a6d158c9";
  private static final String DEFAULT_UA = "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4) Gecko/20091111 Gentoo Firefox/3.5.4";
  public static final String END_MP_BOUNDARY = "--7d4a6d158c9--";
  public static final int FORBIDDEN = 403;
  public static final int INTERNAL_SERVER_ERROR = 500;
  public static final String MP_BOUNDARY = "--7d4a6d158c9";
  public static final String MULTIPART_FORM_DATA = "multipart/form-data";
  public static final int NOT_ACCEPTABLE = 406;
  public static final int NOT_AUTHORIZED = 401;
  public static final int NOT_FOUND = 404;
  public static final int NOT_MODIFIED = 304;
  public static final int OK = 200;
  public static final int SERVICE_UNAVAILABLE = 503;
  private static final long serialVersionUID = 7922696417952706047L;
  private int connectionTimeout;
  private String proxyAuthPassword;
  private String proxyAuthUser;
  private String proxyHost;
  private int proxyPort;
  private int readTimeout;
  private Map<String, String> requestHeaders;
  private int retryCount;
  private int retryIntervalMillis;

  public HttpClient()
  {
    HashMap localHashMap = new HashMap();
    this.requestHeaders = localHashMap;
    this.connectionTimeout = 50000;
    this.readTimeout = 40000;
    this.retryCount = 0;
    this.retryIntervalMillis = 5000;
    setDefaultUserAgent();
    setRequestHeader("Accept-Encoding", "gzip,deflate");
    setRequestHeader("Connection", "keep-alive");
  }

  private void imageContentToUpload(OutputStream paramOutputStream, File paramFile)
    throws IOException
  {
    FileInputStream localFileInputStream = new FileInputStream(paramFile);
    String str = paramFile.getName();
    imageContentToUpload(paramOutputStream, localFileInputStream, str);
  }

  private void imageContentToUpload(OutputStream paramOutputStream, InputStream paramInputStream, String paramString)
    throws IOException
  {
    StringBuilder localStringBuilder1 = new StringBuilder();
    StringBuilder localStringBuilder2 = localStringBuilder1.append("--7d4a6d158c9").append("\r\n");
    StringBuilder localStringBuilder3 = localStringBuilder1.append("Content-Disposition: form-data; name=\"pic\"; filename=\"").append(paramString).append("\"\r\n");
    String str = "image/png";
    BufferedInputStream localBufferedInputStream;
    byte[] arrayOfByte2;
    if ((paramString.endsWith(".jpg")) || (paramString.endsWith(".jpeg")))
    {
      str = "image/jpeg";
      StringBuilder localStringBuilder4 = localStringBuilder1.append("Content-Type: ").append(str).append("\r\n\r\n");
      byte[] arrayOfByte1 = localStringBuilder1.toString().getBytes();
      paramOutputStream.write(arrayOfByte1);
      localBufferedInputStream = new BufferedInputStream(paramInputStream);
      arrayOfByte2 = new byte[524288];
    }
    while (true)
    {
      int i = localBufferedInputStream.read(arrayOfByte2);
      if (i == -1)
      {
        boolean bool = CleanUtils.closeStream(localBufferedInputStream);
        byte[] arrayOfByte3 = "\r\n".getBytes();
        paramOutputStream.write(arrayOfByte3);
        return;
        if (!paramString.endsWith(".gif"))
          break;
        str = "image/gif";
        break;
      }
      paramOutputStream.write(arrayOfByte2, 0, i);
    }
  }

  private void imageContentToUpload(OutputStream paramOutputStream, String paramString)
    throws IOException
  {
    File localFile = new File(paramString);
    imageContentToUpload(paramOutputStream, localFile);
  }

  private void paramToUpload(OutputStream paramOutputStream, String paramString1, String paramString2)
    throws IOException
  {
    StringBuilder localStringBuilder1 = new StringBuilder(10);
    localStringBuilder1.setLength(0);
    StringBuilder localStringBuilder2 = localStringBuilder1.append("--7d4a6d158c9").append("\r\n");
    StringBuilder localStringBuilder3 = localStringBuilder1.append("content-disposition: form-data; name=\"").append(paramString1).append("\"\r\n\r\n");
    StringBuilder localStringBuilder4 = localStringBuilder1.append(paramString2).append("\r\n");
    byte[] arrayOfByte = localStringBuilder1.toString().getBytes();
    paramOutputStream.write(arrayOfByte);
  }

  private void setHttpConnectionRequestMethod(HttpURLConnection paramHttpURLConnection, String paramString)
  {
    try
    {
      paramHttpURLConnection.setRequestMethod(paramString);
      return;
    }
    catch (ProtocolException localProtocolException)
    {
    }
    throw new RuntimeException(localProtocolException);
  }

  private void writeEndToUpload(OutputStream paramOutputStream)
    throws IOException
  {
    byte[] arrayOfByte = "\r\n--7d4a6d158c9--".getBytes();
    paramOutputStream.write(arrayOfByte);
  }

  public Response delete(String paramString)
    throws HttpException
  {
    return httpRequest(paramString, "DELETE", null);
  }

  public boolean equals(Object paramObject)
  {
    int i;
    if (this == paramObject)
      i = 1;
    while (true)
    {
      return i;
      if (!(paramObject instanceof HttpClient))
      {
        i = 0;
        continue;
      }
      HttpClient localHttpClient = (HttpClient)paramObject;
      int j = this.connectionTimeout;
      int k = localHttpClient.connectionTimeout;
      if (j != k)
      {
        i = 0;
        continue;
      }
      int m = this.proxyPort;
      int n = localHttpClient.proxyPort;
      if (m != n)
      {
        i = 0;
        continue;
      }
      int i1 = this.readTimeout;
      int i2 = localHttpClient.readTimeout;
      if (i1 != i2)
      {
        i = 0;
        continue;
      }
      int i3 = this.retryCount;
      int i4 = localHttpClient.retryCount;
      if (i3 != i4)
      {
        i = 0;
        continue;
      }
      int i5 = this.retryIntervalMillis;
      int i6 = localHttpClient.retryIntervalMillis;
      if (i5 != i6)
      {
        i = 0;
        continue;
      }
      if (this.proxyAuthPassword != null)
      {
        String str1 = this.proxyAuthPassword;
        String str2 = localHttpClient.proxyAuthPassword;
        if (str1.equals(str2));
      }
      else
      {
        do
        {
          i = 0;
          break;
        }
        while (localHttpClient.proxyAuthPassword != null);
      }
      if (this.proxyAuthUser != null)
      {
        String str3 = this.proxyAuthUser;
        String str4 = localHttpClient.proxyAuthUser;
        if (str3.equals(str4));
      }
      else
      {
        do
        {
          i = 0;
          break;
        }
        while (localHttpClient.proxyAuthUser != null);
      }
      if (this.proxyHost != null)
      {
        String str5 = this.proxyHost;
        String str6 = localHttpClient.proxyHost;
        if (str5.equals(str6));
      }
      else
      {
        do
        {
          i = 0;
          break;
        }
        while (localHttpClient.proxyHost != null);
      }
      Map localMap1 = this.requestHeaders;
      Map localMap2 = localHttpClient.requestHeaders;
      if (!localMap1.equals(localMap2))
      {
        i = 0;
        continue;
      }
      i = 1;
    }
  }

  public Response get(String paramString)
    throws HttpException
  {
    return httpRequest(paramString, "GET", null);
  }

  protected HttpURLConnection getConnection(String paramString)
    throws IOException
  {
    Proxy localProxy;
    if (!TextUtils.isEmpty(this.proxyHost))
    {
      if (!TextUtils.isEmpty(this.proxyAuthUser))
      {
        LogUtils.d(">>>>>>>>>> Proxy <<<<<<<<<<");
        StringBuilder localStringBuilder1 = new StringBuilder("\t\tProxy AuthUser: ");
        String str1 = this.proxyAuthUser;
        LogUtils.d(str1);
        StringBuilder localStringBuilder2 = new StringBuilder("\t\tProxy AuthPassword: ");
        String str2 = this.proxyAuthPassword;
        LogUtils.d(str2);
        Authenticator.setDefault(new HttpClient.1(this));
      }
      Proxy.Type localType = Proxy.Type.HTTP;
      String str3 = this.proxyHost;
      int i = this.proxyPort;
      InetSocketAddress localInetSocketAddress = InetSocketAddress.createUnresolved(str3, i);
      localProxy = new Proxy(localType, localInetSocketAddress);
      StringBuilder localStringBuilder3 = new StringBuilder("\t\tOpening proxied connection(");
      String str4 = this.proxyHost;
      StringBuilder localStringBuilder4 = localStringBuilder3.append(str4).append(":");
      int j = this.proxyPort;
      LogUtils.d(j + ")");
    }
    for (HttpURLConnection localHttpURLConnection = (HttpURLConnection)new URL(paramString).openConnection(localProxy); ; localHttpURLConnection = (HttpURLConnection)new URL(paramString).openConnection())
    {
      if (this.connectionTimeout > 0)
      {
        int k = this.connectionTimeout;
        localHttpURLConnection.setConnectTimeout(k);
      }
      if (this.readTimeout > 0)
      {
        int m = this.readTimeout;
        localHttpURLConnection.setReadTimeout(m);
      }
      return localHttpURLConnection;
    }
  }

  public int getConnectionTimeout()
  {
    return this.connectionTimeout;
  }

  public String getProxyAuthPassword()
  {
    return this.proxyAuthPassword;
  }

  public String getProxyAuthUser()
  {
    return this.proxyAuthUser;
  }

  public String getProxyHost()
  {
    return this.proxyHost;
  }

  public int getProxyPort()
  {
    return this.proxyPort;
  }

  public int getReadTimeout()
  {
    return this.readTimeout;
  }

  public String getRequestHeader(String paramString)
  {
    return (String)this.requestHeaders.get(paramString);
  }

  public int getRetryCount()
  {
    return this.retryCount;
  }

  public int getRetryIntervalMillis()
  {
    return this.retryIntervalMillis;
  }

  public String getUserAgent()
  {
    return getRequestHeader("User-Agent");
  }

  public int hashCode()
  {
    int i = (this.retryCount + 31) * 31;
    int j = this.retryIntervalMillis;
    int k = (i + j) * 31;
    if (this.proxyHost != null)
    {
      m = this.proxyHost.hashCode();
      int n = (k + m) * 31;
      int i1 = this.proxyPort;
      k = (n + i1) * 31;
      if (this.proxyAuthUser == null)
        break label167;
      m = this.proxyAuthUser.hashCode();
      label79: k = (k + m) * 31;
      if (this.proxyAuthPassword == null)
        break label173;
    }
    label167: label173: for (int m = this.proxyAuthPassword.hashCode(); ; m = 0)
    {
      int i2 = (k + m) * 31;
      int i3 = this.connectionTimeout;
      int i4 = (i2 + i3) * 31;
      int i5 = this.readTimeout;
      int i6 = (i4 + i5) * 31;
      int i7 = this.requestHeaders.hashCode();
      return i6 + i7;
      m = 0;
      break;
      m = 0;
      break label79;
    }
  }

  protected Response httpRequest(String paramString1, String paramString2, List<PostParameter> paramList)
    throws HttpException
  {
    PostParameter[] arrayOfPostParameter1 = new PostParameter[0];
    PostParameter[] arrayOfPostParameter2 = (PostParameter[])paramList.toArray(arrayOfPostParameter1);
    return httpRequest(paramString1, paramString2, arrayOfPostParameter2);
  }

  // ERROR //
  protected Response httpRequest(String paramString1, String paramString2, PostParameter[] paramArrayOfPostParameter)
    throws HttpException
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 362	sudroid/AssertUtil:checkStringNullOrEmpty	(Ljava/lang/CharSequence;)V
    //   4: aload_0
    //   5: getfield 76	sudroid/net2/HttpClient:retryCount	I
    //   8: iconst_1
    //   9: iadd
    //   10: istore 4
    //   12: iconst_0
    //   13: checkcast 364	[B
    //   16: astore 5
    //   18: aconst_null
    //   19: astore 6
    //   21: iconst_0
    //   22: istore 7
    //   24: aconst_null
    //   25: astore 8
    //   27: iload 7
    //   29: istore 9
    //   31: iload 4
    //   33: istore 10
    //   35: iload 9
    //   37: iload 10
    //   39: if_icmplt +20 -> 59
    //   42: aload 8
    //   44: astore 11
    //   46: aload 11
    //   48: ifnonnull +967 -> 1015
    //   51: aload 6
    //   53: ifnull +962 -> 1015
    //   56: aload 6
    //   58: athrow
    //   59: iload 7
    //   61: ifeq +48 -> 109
    //   64: new 120	java/lang/StringBuilder
    //   67: dup
    //   68: ldc_w 366
    //   71: invokespecial 264	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   74: astore 12
    //   76: aload_0
    //   77: getfield 78	sudroid/net2/HttpClient:retryIntervalMillis	I
    //   80: istore 13
    //   82: aload 12
    //   84: iload 13
    //   86: invokevirtual 301	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   89: ldc_w 368
    //   92: invokevirtual 125	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   95: invokevirtual 152	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   98: invokestatic 261	sudroid/LogUtils:d	(Ljava/lang/CharSequence;)V
    //   101: aload_0
    //   102: getfield 78	sudroid/net2/HttpClient:retryIntervalMillis	I
    //   105: i2l
    //   106: invokestatic 374	java/lang/Thread:sleep	(J)V
    //   109: aload_0
    //   110: aload_1
    //   111: invokevirtual 376	sudroid/net2/HttpClient:getConnection	(Ljava/lang/String;)Ljava/net/HttpURLConnection;
    //   114: astore 14
    //   116: aload_0
    //   117: astore 15
    //   119: aload_1
    //   120: astore 16
    //   122: aload_3
    //   123: astore 17
    //   125: aload 14
    //   127: astore 18
    //   129: aload 15
    //   131: aload 16
    //   133: aload 17
    //   135: aload 18
    //   137: invokevirtual 380	sudroid/net2/HttpClient:setHeaders	(Ljava/lang/String;[Lsudroid/net2/PostParameter;Ljava/net/HttpURLConnection;)V
    //   140: aload_3
    //   141: ifnull +693 -> 834
    //   144: aload_2
    //   145: astore 19
    //   147: ldc 245
    //   149: astore 20
    //   151: aload 19
    //   153: aload 20
    //   155: invokevirtual 237	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   158: ifne +676 -> 834
    //   161: aload_0
    //   162: astore 21
    //   164: aload 14
    //   166: astore 22
    //   168: ldc_w 382
    //   171: astore 23
    //   173: aload 21
    //   175: aload 22
    //   177: aload 23
    //   179: invokespecial 384	sudroid/net2/HttpClient:setHttpConnectionRequestMethod	(Ljava/net/HttpURLConnection;Ljava/lang/String;)V
    //   182: aload 14
    //   184: astore 24
    //   186: ldc_w 385
    //   189: istore 25
    //   191: aload 24
    //   193: iload 25
    //   195: invokevirtual 389	java/net/HttpURLConnection:setUseCaches	(Z)V
    //   198: aload_3
    //   199: invokestatic 393	sudroid/net2/PostParameter:containsFile	([Lsudroid/net2/PostParameter;)Z
    //   202: ifeq +508 -> 710
    //   205: aload 14
    //   207: astore 26
    //   209: ldc_w 395
    //   212: astore 27
    //   214: ldc_w 397
    //   217: astore 28
    //   219: aload 26
    //   221: aload 27
    //   223: aload 28
    //   225: invokevirtual 400	java/net/HttpURLConnection:setRequestProperty	(Ljava/lang/String;Ljava/lang/String;)V
    //   228: aload 14
    //   230: astore 29
    //   232: ldc_w 401
    //   235: istore 30
    //   237: aload 29
    //   239: iload 30
    //   241: invokevirtual 404	java/net/HttpURLConnection:setDoOutput	(Z)V
    //   244: new 406	java/io/ByteArrayOutputStream
    //   247: astore 31
    //   249: aload 31
    //   251: astore 32
    //   253: ldc 168
    //   255: istore 33
    //   257: aload 32
    //   259: iload 33
    //   261: invokespecial 407	java/io/ByteArrayOutputStream:<init>	(I)V
    //   264: aload_3
    //   265: arraylength
    //   266: istore 34
    //   268: iconst_0
    //   269: istore 35
    //   271: iload 35
    //   273: istore 36
    //   275: iload 34
    //   277: istore 37
    //   279: iload 36
    //   281: iload 37
    //   283: if_icmplt +291 -> 574
    //   286: aload_0
    //   287: astore 38
    //   289: aload 31
    //   291: astore 39
    //   293: aload 38
    //   295: aload 39
    //   297: invokespecial 409	sudroid/net2/HttpClient:writeEndToUpload	(Ljava/io/OutputStream;)V
    //   300: aload 31
    //   302: invokevirtual 412	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   305: astore 40
    //   307: aload 31
    //   309: invokestatic 178	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   312: istore 41
    //   314: aload 40
    //   316: arraylength
    //   317: invokestatic 417	java/lang/Integer:toString	(I)Ljava/lang/String;
    //   320: astore 42
    //   322: aload 14
    //   324: astore 43
    //   326: ldc_w 419
    //   329: astore 44
    //   331: aload 42
    //   333: astore 45
    //   335: aload 43
    //   337: aload 44
    //   339: aload 45
    //   341: invokevirtual 400	java/net/HttpURLConnection:setRequestProperty	(Ljava/lang/String;Ljava/lang/String;)V
    //   344: new 421	java/io/BufferedOutputStream
    //   347: astore 46
    //   349: aload 14
    //   351: invokevirtual 425	java/net/HttpURLConnection:getOutputStream	()Ljava/io/OutputStream;
    //   354: astore 47
    //   356: aload 46
    //   358: astore 48
    //   360: aload 47
    //   362: astore 49
    //   364: aload 48
    //   366: aload 49
    //   368: invokespecial 427	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   371: aload 46
    //   373: aload 40
    //   375: invokevirtual 428	java/io/BufferedOutputStream:write	([B)V
    //   378: aload 46
    //   380: invokestatic 178	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   383: istore 50
    //   385: new 430	sudroid/net2/Response
    //   388: dup
    //   389: aload 14
    //   391: invokespecial 433	sudroid/net2/Response:<init>	(Ljava/net/HttpURLConnection;)V
    //   394: astore 11
    //   396: aload 14
    //   398: invokevirtual 436	java/net/HttpURLConnection:getResponseCode	()I
    //   401: istore 51
    //   403: iload 51
    //   405: istore 52
    //   407: ldc_w 438
    //   410: invokestatic 261	sudroid/LogUtils:d	(Ljava/lang/CharSequence;)V
    //   413: aload 14
    //   415: invokevirtual 442	java/net/HttpURLConnection:getHeaderFields	()Ljava/util/Map;
    //   418: invokeinterface 446 1 0
    //   423: invokeinterface 452 1 0
    //   428: astore 34
    //   430: aload 34
    //   432: invokeinterface 458 1 0
    //   437: ifne +460 -> 897
    //   440: ldc_w 460
    //   443: invokestatic 261	sudroid/LogUtils:d	(Ljava/lang/CharSequence;)V
    //   446: iload 52
    //   448: istore 53
    //   450: sipush 200
    //   453: istore 54
    //   455: iload 53
    //   457: iload 54
    //   459: if_icmpeq -413 -> 46
    //   462: iload 52
    //   464: istore 55
    //   466: sipush 500
    //   469: istore 56
    //   471: iload 55
    //   473: iload 56
    //   475: if_icmplt +24 -> 499
    //   478: aload_0
    //   479: getfield 76	sudroid/net2/HttpClient:retryCount	I
    //   482: istore 57
    //   484: iload 7
    //   486: istore 58
    //   488: iload 57
    //   490: istore 59
    //   492: iload 58
    //   494: iload 59
    //   496: if_icmpne +201 -> 697
    //   499: new 225	sudroid/net2/HttpException
    //   502: astore 60
    //   504: iload 52
    //   506: invokestatic 463	sudroid/net2/HttpException:getCause	(I)Ljava/lang/String;
    //   509: invokestatic 467	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   512: astore 61
    //   514: new 120	java/lang/StringBuilder
    //   517: dup
    //   518: aload 61
    //   520: invokespecial 264	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   523: ldc_w 469
    //   526: invokevirtual 125	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   529: astore 62
    //   531: aload 11
    //   533: invokevirtual 472	sudroid/net2/Response:asString	()Ljava/lang/String;
    //   536: astore 63
    //   538: aload 62
    //   540: aload 63
    //   542: invokevirtual 125	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   545: invokevirtual 152	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   548: astore 64
    //   550: aload 60
    //   552: astore 65
    //   554: aload 64
    //   556: astore 66
    //   558: iload 52
    //   560: istore 67
    //   562: aload 65
    //   564: aload 66
    //   566: iload 67
    //   568: invokespecial 475	sudroid/net2/HttpException:<init>	(Ljava/lang/String;I)V
    //   571: aload 60
    //   573: athrow
    //   574: aload_3
    //   575: iload 35
    //   577: aaload
    //   578: astore 68
    //   580: aload 68
    //   582: invokevirtual 478	sudroid/net2/PostParameter:isFile	()Z
    //   585: ifeq +52 -> 637
    //   588: aload 68
    //   590: invokevirtual 482	sudroid/net2/PostParameter:getInput	()Ljava/io/InputStream;
    //   593: astore 69
    //   595: aload 68
    //   597: invokevirtual 483	sudroid/net2/PostParameter:getName	()Ljava/lang/String;
    //   600: astore 70
    //   602: aload_0
    //   603: astore 71
    //   605: aload 31
    //   607: astore 72
    //   609: aload 69
    //   611: astore 73
    //   613: aload 70
    //   615: astore 74
    //   617: aload 71
    //   619: aload 72
    //   621: aload 73
    //   623: aload 74
    //   625: invokespecial 118	sudroid/net2/HttpClient:imageContentToUpload	(Ljava/io/OutputStream;Ljava/io/InputStream;Ljava/lang/String;)V
    //   628: iload 35
    //   630: iconst_1
    //   631: iadd
    //   632: istore 35
    //   634: goto -363 -> 271
    //   637: aload 68
    //   639: getfield 486	sudroid/net2/PostParameter:name	Ljava/lang/String;
    //   642: astore 75
    //   644: aload 68
    //   646: getfield 489	sudroid/net2/PostParameter:value	Ljava/lang/String;
    //   649: astore 76
    //   651: aload_0
    //   652: astore 77
    //   654: aload 31
    //   656: astore 78
    //   658: aload 75
    //   660: astore 79
    //   662: aload 76
    //   664: astore 80
    //   666: aload 77
    //   668: aload 78
    //   670: aload 79
    //   672: aload 80
    //   674: invokespecial 491	sudroid/net2/HttpClient:paramToUpload	(Ljava/io/OutputStream;Ljava/lang/String;Ljava/lang/String;)V
    //   677: goto -49 -> 628
    //   680: astore 81
    //   682: aload 8
    //   684: astore 11
    //   686: new 225	sudroid/net2/HttpException
    //   689: dup
    //   690: aload 81
    //   692: invokespecial 494	sudroid/net2/HttpException:<init>	(Ljava/lang/Exception;)V
    //   695: astore 6
    //   697: iload 7
    //   699: iconst_1
    //   700: iadd
    //   701: istore 7
    //   703: aload 11
    //   705: astore 8
    //   707: goto -680 -> 27
    //   710: aload 14
    //   712: astore 82
    //   714: ldc_w 395
    //   717: astore 83
    //   719: ldc_w 496
    //   722: astore 84
    //   724: aload 82
    //   726: aload 83
    //   728: aload 84
    //   730: invokevirtual 400	java/net/HttpURLConnection:setRequestProperty	(Ljava/lang/String;Ljava/lang/String;)V
    //   733: aload 14
    //   735: astore 85
    //   737: ldc_w 401
    //   740: istore 86
    //   742: aload 85
    //   744: iload 86
    //   746: invokevirtual 404	java/net/HttpURLConnection:setDoOutput	(Z)V
    //   749: aload_3
    //   750: invokestatic 500	sudroid/net2/PostParameter:encodeParameters	([Lsudroid/net2/PostParameter;)Ljava/lang/String;
    //   753: astore 87
    //   755: new 120	java/lang/StringBuilder
    //   758: dup
    //   759: ldc_w 502
    //   762: invokespecial 264	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   765: astore 88
    //   767: aload 87
    //   769: astore 89
    //   771: aload 88
    //   773: aload 89
    //   775: invokevirtual 125	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   778: invokevirtual 152	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   781: invokestatic 261	sudroid/LogUtils:d	(Ljava/lang/CharSequence;)V
    //   784: aload 87
    //   786: astore 90
    //   788: ldc_w 504
    //   791: astore 91
    //   793: aload 90
    //   795: aload 91
    //   797: invokevirtual 507	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   800: astore 51
    //   802: aload 51
    //   804: astore 40
    //   806: goto -492 -> 314
    //   809: astore 81
    //   811: new 214	java/lang/RuntimeException
    //   814: astore 92
    //   816: aload 92
    //   818: astore 93
    //   820: aload 81
    //   822: astore 94
    //   824: aload 93
    //   826: aload 94
    //   828: invokespecial 217	java/lang/RuntimeException:<init>	(Ljava/lang/Throwable;)V
    //   831: aload 92
    //   833: athrow
    //   834: ldc 227
    //   836: astore 95
    //   838: aload_2
    //   839: astore 96
    //   841: aload 95
    //   843: aload 96
    //   845: invokevirtual 237	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   848: ifeq +26 -> 874
    //   851: aload_0
    //   852: astore 97
    //   854: aload 14
    //   856: astore 98
    //   858: ldc 227
    //   860: astore 99
    //   862: aload 97
    //   864: aload 98
    //   866: aload 99
    //   868: invokespecial 384	sudroid/net2/HttpClient:setHttpConnectionRequestMethod	(Ljava/net/HttpURLConnection;Ljava/lang/String;)V
    //   871: goto -486 -> 385
    //   874: aload_0
    //   875: astore 100
    //   877: aload 14
    //   879: astore 101
    //   881: ldc 245
    //   883: astore 102
    //   885: aload 100
    //   887: aload 101
    //   889: aload 102
    //   891: invokespecial 384	sudroid/net2/HttpClient:setHttpConnectionRequestMethod	(Ljava/net/HttpURLConnection;Ljava/lang/String;)V
    //   894: goto -509 -> 385
    //   897: aload 34
    //   899: invokeinterface 511 1 0
    //   904: checkcast 513	java/util/Map$Entry
    //   907: astore 103
    //   909: aload 103
    //   911: invokeinterface 516 1 0
    //   916: checkcast 347	java/util/List
    //   919: invokeinterface 517 1 0
    //   924: astore 35
    //   926: aload 35
    //   928: invokeinterface 458 1 0
    //   933: ifeq -503 -> 430
    //   936: aload 35
    //   938: invokeinterface 511 1 0
    //   943: checkcast 137	java/lang/String
    //   946: astore 104
    //   948: new 120	java/lang/StringBuilder
    //   951: dup
    //   952: ldc_w 519
    //   955: invokespecial 264	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   958: astore 105
    //   960: aload 103
    //   962: invokeinterface 522 1 0
    //   967: checkcast 137	java/lang/String
    //   970: astore 106
    //   972: aload 105
    //   974: astore 107
    //   976: aload 106
    //   978: astore 108
    //   980: aload 107
    //   982: aload 108
    //   984: invokevirtual 125	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   987: ldc_w 524
    //   990: invokevirtual 125	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   993: astore 109
    //   995: aload 104
    //   997: astore 110
    //   999: aload 109
    //   1001: aload 110
    //   1003: invokevirtual 125	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   1006: invokevirtual 152	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   1009: invokestatic 261	sudroid/LogUtils:d	(Ljava/lang/CharSequence;)V
    //   1012: goto -86 -> 926
    //   1015: aload 11
    //   1017: areturn
    //   1018: astore 81
    //   1020: goto -334 -> 686
    //   1023: astore 111
    //   1025: goto -916 -> 109
    //
    // Exception table:
    //   from	to	target	type
    //   109	396	680	java/io/IOException
    //   574	677	680	java/io/IOException
    //   710	784	680	java/io/IOException
    //   784	802	680	java/io/IOException
    //   811	894	680	java/io/IOException
    //   784	802	809	java/io/UnsupportedEncodingException
    //   396	403	1018	java/io/IOException
    //   64	109	1023	java/lang/InterruptedException
  }

  public Response post(String paramString, List<PostParameter> paramList)
    throws HttpException
  {
    return httpRequest(paramString, "POST", paramList);
  }

  public Response post(String paramString, PostParameter[] paramArrayOfPostParameter)
    throws HttpException
  {
    return httpRequest(paramString, "POST", paramArrayOfPostParameter);
  }

  public void setConnectionTimeout(int paramInt)
  {
    this.connectionTimeout = paramInt;
  }

  public void setDefaultUserAgent()
  {
    setUserAgent("Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4) Gecko/20091111 Gentoo Firefox/3.5.4");
  }

  protected void setHeaders(String paramString, PostParameter[] paramArrayOfPostParameter, HttpURLConnection paramHttpURLConnection)
  {
    LogUtils.d(">>>>>>>>>> Request <<<<<<<<<<");
    Iterator localIterator;
    if ((paramArrayOfPostParameter == null) || (paramArrayOfPostParameter.length == 0))
    {
      LogUtils.d("\t\tGET " + paramString);
      localIterator = this.requestHeaders.keySet().iterator();
    }
    while (true)
    {
      if (!localIterator.hasNext())
      {
        return;
        LogUtils.d("\t\tPOST " + paramString);
        break;
      }
      String str1 = (String)localIterator.next();
      String str2 = (String)this.requestHeaders.get(str1);
      paramHttpURLConnection.addRequestProperty(str1, str2);
      StringBuilder localStringBuilder = new StringBuilder("\t\t").append(str1).append(": ");
      String str3 = (String)this.requestHeaders.get(str1);
      LogUtils.d(str3);
    }
  }

  public void setProxyAuthPassword(String paramString)
  {
    this.proxyAuthPassword = paramString;
  }

  public void setProxyAuthUser(String paramString)
  {
    this.proxyAuthUser = paramString;
  }

  public void setProxyHost(String paramString)
  {
    this.proxyHost = paramString;
  }

  public void setProxyPort(int paramInt)
  {
    this.proxyPort = paramInt;
  }

  public void setReadTimeout(int paramInt)
  {
    this.readTimeout = paramInt;
  }

  public void setRequestHeader(String paramString1, String paramString2)
  {
    Object localObject = this.requestHeaders.put(paramString1, paramString2);
  }

  public void setRetryCount(int paramInt)
  {
    if (paramInt >= 0)
      this.retryCount = paramInt;
  }

  public void setRetryIntervalMillis(int paramInt)
  {
    if (paramInt >= 0)
      this.retryIntervalMillis = paramInt;
  }

  public void setUserAgent(String paramString)
  {
    setRequestHeader("User-Agent", paramString);
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.net2.HttpClient
 * JD-Core Version:    0.6.0
 */